<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Unibox</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="bootstrap-select.min.css">
<link href="css/animate.css" rel="stylesheet" type="text/css">

<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="project/js/ricerca.js"></script>
<script src="project/js/globals.js"></script>

<style>
tbody tr:hover {
	color: blue;
	cursor: pointer;
}
</style>
</head>
<body>

	<%@ page import="it.unisa.unibox.beans.Account"%>
	<%@ page import="it.unisa.unibox.beans.Ricercatore"%>

	<%
		Ricercatore ric = (Ricercatore) session.getAttribute("ricercatore");
		Account ac = (Account) session.getAttribute("account");
		if (ac == null) {
			response.sendRedirect("index.jsp");
		}
	%>

	<div class="main">
		<div class="page">
			<div class="header">
				<div class="header_logo"></div>
			</div>
			<div class="topmenu">
				<ul>
					<li
						style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; padding-left: 0px;">
						<a href="home.jsp">Home</a>
					</li>
					<li><a href="ricerca.jsp" style="color: #33CCCC">Ricerca</a></li>
					<li><a href="inserimento.jsp">Inserimento</a></li>
					<%
						if (ric != null && (ric.getRuolo() == 2 || ric.getRuolo() == 3)) {
					%>
					<li><a href="validazione.jsp">Validazione</a></li>
					<%
						}
					%>

					<li id="notify"></li>

					<a onClick="logout()" class="btn btn logout">Logout</a>
				</ul>
			</div>
			<!--HEADER-->

			<div class="content">
				<!--DIV PRINCIPALE-->

				<div class="row-fluid offset2">
					<!--Body  cambiare l'offset x la posizione-->

					<h3>Ricerca dei prodotti</h3>
					<form name="form_ricerca_prodotto" id="formricerca" method="post"
						action="./ricercaProdotto">
						<!--Inserire l'action!!!-->


						<div class="row-fluid">
							<div class="span2">
								<label class="control-label" for="prodotto_tipologia">Tipologia
									di prodotto</label>
							</div>

							<div class="controls span2">
								<select select class="selectpicker" data-style="btn-primary"
									data-toggle="tooltip" id="prodotto_tipologia"
									name="prodotto_tipologia">
									<optgroup label="Tipologia">
										<option value=""></option>
										<option>Articolo Rivista</option>
										<option>Articolo Libro</option>
										<option>Monografia</option>
										<option>Atti Congresso</option>
										<option>Brevetto</option>
										<option>Curatela</option>
										<option>Altro</option>
									</optgroup>
								</select>
							</div>
						</div>

						<div class="row-fluid">
							<div class="span2">

								<label>Anno Pubblicazione</label>
							</div>
							<div class="span6">
								Da <select id="annoDa" style="width: 91px" name="annoDa"
									onChange="cambiaAnno(this.value)">
									<option value=""></option>

								</select> a <select id="annoA" style="width: 91px" name="annoA">
									<option value=""></option>

								</select>
							</div>
						</div>



						<div class="row-fluid">
							<div class="span2">
								<label class="control-label" for="prodotto_titolo">Titolo
									prodotto</label>
							</div>
							<div class="controls span2">
								<input data-toggle="tooltip" type="text" id="prodotto_titolo"
									name="prodotto_titolo"> <span class="help-inline"></span>
							</div>
						</div>

						<div class="accordion" id="accordion2">
							<div class="accordion-group span6">
								<div class="accordion-heading">
									<a class="accordion-toggle" data-toggle="collapse"
										data-parent="#accordion2" href="#collapseOne"> Avanzate </a>
								</div>
								<div id="collapseOne" class="accordion-body collapse">
									<!--Se si aggiunge "in" dopo collapse sarà aperta di default-->
									<div class="accordion-inner">
										<!--PARTE NASCOSTA :P !!!-->

										<div class="row-fluid">
											<div class="span2">
												<label class="control-label" for="nome">Nome</label>
											</div>
											<div class="controls span2 offset1">
												<input data-toggle="tooltip" type="text" id="nome"
													name="nome"> <span class="help-inline"></span>
											</div>
										</div>

										<div class="row-fluid">
											<div class="span2">
												<label class="control-label" for="cognome">Cognome</label>
											</div>
											<div class="controls span2 offset1">
												<input data-toggle="tooltip" type="text" id="cognome"
													name="cognome"> <span class="help-inline"></span>
											</div>
										</div>

										<div class="row-fluid">
											<div class="span2">
												<label class="control-label" for="cod_fiscale">Codice
													Fiscale</label>
											</div>
											<div class="controls span2 offset1">
												<input data-toggle="tooltip" type="text" id="cod_fiscale"
													name="cod_fiscale"> <span class="help-inline"></span>
											</div>
										</div>

										<div class="row-fluid">
											<div class="span2">
												<label class="control-label" for="dipartimento">Dipartimento</label>
											</div>

											<div class="controls span2 offset1">
												<select data-toggle="tooltip" id="dipartimento"
													name="dipartimento">
													<option value=""></option>
												</select>
											</div>
										</div>
										<div class="row-fluid">
											<div class="span2">
												<label class="control-label" for="area">Area
													Scientifica</label>
											</div>

											<div class="controls span2 offset1">
												<select data-toggle="tooltip" id="area" name="area">

													<option value=""></option>

												</select>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="row-fluid">
							<div class="span2 offset1">

								<a onClick="ricercaProdotti()" role="button"
									class="btn btn-success" data-toggle="modal">&nbsp;Cerca&nbsp;</a>



								<br> </br> <a href="#conferma_annulla" role="button"
									class="btn btn-danger" data-toggle="modal">Annulla</a>
							</div>


						</div>
						<div class="row-fluid">
							<div class="span2">

								<label>Ordina per:</label>
							</div>
							<div class="span6">
								<select data-toggle="tooltip" onChange="ricercaProdotti()"
									id="ordine" name="ordine">

									<option value="titolo">Titolo</option>
									<option value="anno">Anno</option>
									<option value="responsabile">Responsabile</option>
									<option value="tipologia">Tipologia</option>

								</select>
							</div>
						</div>
					</form>



				</div>
				<!--fine body-->

				<div  class="row-fluid">
					<div class="span8 offset2">


						<table id="result" class="table" border=2>
							<!-- Tabella prodotti -->
							<thead id=intestazione>

							</thead>
							<tbody id="listaProdotti">
								<!-- IL CONTENUTO DINAMICO DELLA TABELLA SI AGGIUNGE QUI -->

							</tbody>


						</table>
					</div>


				</div>

				<div class="footer">
					<!--DO NOT Remove The Footer Links-->
					<img src="images/footnote.gif" class="copyright"
						alt="html templates"></a>
						<p>
							&copy; Copyright 2010. Designed by <a class="footer-link"
								target="_blank">Unibox Studio</a>
							<!--DO NOT Remove The Footer Links-->
						</p>
				</div>
				<!--Chiusura DIV FOOTER-->



			</div>
			<!--DIV PRINCIPALE-->

			<a id=cerca href="#parametri_ricerca" style="visibility: hidden"
				data-toggle="modal"></a> <a id=nessunRisultatoButton
				href="#nessun_risultato" style="visibility: hidden"
				data-toggle="modal"></a>

			<!--DIV ANNULLA-->
			<div id="conferma_annulla" class="modal hide fade" tabindex="-1"
				role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">x</button>
					<h4 id="myModalLabel">Annulla Operazione</h4>
				</div>
				<div class="modal-body">
					<p>Sei sicuro di voler annullare l'operazione ?(I dati di
						ricerca saranno cancellati)</p>
				</div>
				<div class="modal-footer">
					<button class="btn" data-dismiss="modal" aria-hidden="true">Annulla</button>
					<button class="btn btn-danger" onClick="resetForm('#formricerca')"
						data-dismiss="modal">Conferma</button>
				</div>
			</div>
			<!--DIV ANNULLA-->

			<!--DIV INSERISCI ALMENO UN CAMPO DI RICERCA-->
			<div id="parametri_ricerca" class="modal hide fade" tabindex="-1"
				role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">x</button>
					<h4 id="myModalLabel">Campi ricerca</h4>
				</div>
				<div class="modal-body">
					<p>Inserisci almeno un parametro di ricerca!</p>
				</div>
				<div class="modal-footer">
					<button class="btn btn-danger" data-dismiss="modal">Conferma
					</button>
				</div>
			</div>
			<!--DIV ANNULLA-->

			<!--DIV NESSUN RISULTATO RICERCA-->
			<div id="nessun_risultato" class="modal hide fade" tabindex="-1"
				role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">x</button>
					<h4 id="myModalLabel">Ricerca eseguita</h4>
				</div>
				<div class="modal-body">
					<p>Non &egrave stato trovato nessun prodotto che risponde ai
						parametri specificati.</p>
					<p>
						Controllare i dati inseriti.
						<w /p>
				</div>
				<div class="modal-footer">
					<button class="btn btn-success" data-dismiss="modal">Conferma
					</button>
				</div>
			</div>
			<!--DIV ANNULLA-->

			<div id="notifica" class="modal hide fade" tabindex="-1"
				role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">x</button>
					<h4 id="myModalLabel">Notifiche</h4>
				</div>
				<div class="modal-body" id="body_notify"></div>
				<div class="modal-footer">
					<button id="notifica_esci" class="btn btn-primary"
						data-dismiss="modal" aria-hidden="true">Esci</button>
				</div>
			</div>
</body>

</html>
